package org.springframework.samples.mvc.fileupload;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

public class Common {

	// save to somewhere
	public static void writeFile(byte[] content, String filename) throws IOException {
 
		File file = new File(filename);
 
		if (!file.exists()) {
			file.createNewFile();
		}
 
		FileOutputStream fop = new FileOutputStream(file);
 
		fop.write(content);
		fop.flush();
		fop.close();
 
	}
}
